const isType = (type) => {
    return (obj) => {
        return {}.toString.call(obj) == `[object ${type}]`;
    }
}
const owns = Object.prototype.hasOwnProperty;

export const isObject = isType('Object');
export const isString = isType('String');
export const isArray = Array.isArray || isType('Array');
export const isFunction = isType('Function');
export const isDate = isType('Date');
export const isNumber = isType('Number');
export const isUndef = isType('Undefined');
export const isBoolean = isType('Boolean');
export const isRegExp = isType('RegExp');
export const isEmptyObject = (value) => {
    if (isObject(value)) {
        for(let key in value){
            if(owns.call(value, key)){
                return false;
            }
        }
        return true;
    }
    return false;
}
